﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:c="clr-namespace:WickedFlame.Core.Shapes;assembly=VecDraw.Core"
                    xmlns:t="clr-namespace:WickedFlame.Core.Tools;assembly=VecDraw.Core"
                    xmlns:ctrl="clr-namespace:WickedFlame.VecDraw.Base.Controls;assembly=VecDraw.Base"
                    xmlns:cv="clr-namespace:WickedFlame.Util.Converters;assembly=VecDraw.Util"
                    xmlns:cmds="clr-namespace:WickedFlame.VecDraw.VecApp"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <cv:BrushToColorConverter x:Key="brushtocolor"/>
    <Image Source="/VecDraw.Resources;component/Images/VecDraw.ColorSwitch.SquareLong.png" x:Key="swatchimage"/>
    <Image Source="/VecDraw.Resources;component/Images/VecDraw.ColorSwitch.SquareLong.png" x:Key="swatchimage2"/>

    <ObjectDataProvider x:Key="lineCapsEnum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
        <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="PenLineCap"/>
        </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>

    <DataTemplate x:Key="rectangleType">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Stroke brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="0" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage2}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}" Margin="1"/>

            <TextBlock Grid.Row="1" Grid.Column="0" Text="Fill brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="1" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage}" SelectedColor="{Binding Fill, Converter={StaticResource brushtocolor}}" Margin="1"/>

            <Rectangle Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Fill="Gray" Height="1" Margin="3"/>

            <TextBlock Grid.Row="3" Grid.Column="0" Text="Stroke Thickness" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="1" Grid.Row="3" Text="{Binding StrokeThickness, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            
            <Rectangle Grid.Column="2" Grid.RowSpan="5" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="3" Text="X" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="4" Text="{Binding X, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="5" Text="Y" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="6" Text="{Binding Y, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <TextBlock Grid.Column="3" Grid.Row="1" Text="Height" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="4" Grid.Row="1" Text="{Binding Height, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="5" Grid.Row="1" Text="Width" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="6" Grid.Row="1" Text="{Binding Width, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="lineType">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Stroke brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="0" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage2}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}" Margin="1"/>
            
            <ctrl:ColorSelector Visibility="Hidden" Grid.Row="1" Grid.Column="1" Width="20" Margin="1"/>

            <Rectangle Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Fill="Gray" Height="1" Margin="3"/>

            <TextBlock Grid.Row="3" Grid.Column="0" Text="Stroke Thickness" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="1" Grid.Row="3" Text="{Binding StrokeThickness, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <Rectangle Grid.Column="2" Grid.RowSpan="5" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="3" Text="X1" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="4" Text="{Binding X1, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="5" Text="Y1" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="6" Text="{Binding Y1, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <TextBlock Grid.Column="3" Grid.Row="1" Text="X2" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="4" Grid.Row="1" Text="{Binding X2, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="5" Grid.Row="1" Text="Y2" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="6" Grid.Row="1" Text="{Binding Y2, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="lineWithFillType">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Stroke brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="0" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage2}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}" Margin="1"/>

            <TextBlock Grid.Row="1" Grid.Column="0" Text="Fill brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="1" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage}" SelectedColor="{Binding Fill, Converter={StaticResource brushtocolor}}" Margin="1"/>

            <Rectangle Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Fill="Gray" Height="1" Margin="3"/>

            <TextBlock Grid.Row="3" Grid.Column="0" Text="Stroke Thickness" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="1" Grid.Row="3" Text="{Binding StrokeThickness, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <Rectangle Grid.Column="2" Grid.RowSpan="5" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="3" Text="X1" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="4" Text="{Binding X1, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="5" Text="Y1" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="6" Text="{Binding Y1, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <TextBlock Grid.Column="3" Grid.Row="1" Text="X2" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="4" Grid.Row="1" Text="{Binding X2, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="5" Grid.Row="1" Text="Y2" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="6" Grid.Row="1" Text="{Binding Y2, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

        </Grid>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:RectangleShape}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition />
            </Grid.RowDefinitions>

            <ContentPresenter ContentTemplate="{StaticResource rectangleType}" Grid.RowSpan="3" />
            
            <Rectangle Grid.Column="1" Grid.RowSpan="3" Fill="Gray" Width="1" Margin="5"/>
            
            <TextBlock Grid.Column="2" Text="CornerRadius" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="3" Text="{Binding CornerRadius, UpdateSourceTrigger=PropertyChanged}" Margin="1" />

            <TextBlock Grid.Row="1" Grid.Column="2" Text="Line Cap" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ComboBox Grid.Row="1" Grid.Column="3" ItemsSource="{Binding Source={StaticResource lineCapsEnum}}" SelectedItem="{Binding LineCap}"/>

        </Grid>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:LineShape}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition />
            </Grid.RowDefinitions>
            <ContentPresenter ContentTemplate="{StaticResource lineType}" Grid.RowSpan="3" />

            <Rectangle Grid.Column="1" Grid.RowSpan="5" Fill="Gray" Width="1" Margin="5"/>
            
            <TextBlock Grid.Column="2" Text="Line Cap" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ComboBox Grid.Column="3" ItemsSource="{Binding Source={StaticResource lineCapsEnum}}" SelectedItem="{Binding LineCap}"/>
       
        </Grid>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:EllipseShape}">
        <Grid>
            <ContentPresenter ContentTemplate="{StaticResource rectangleType}" />
        </Grid>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:SCurveShape}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition />
            </Grid.RowDefinitions>

            <ContentPresenter ContentTemplate="{StaticResource lineWithFillType}" Grid.RowSpan="4" />

            <Rectangle Grid.Column="1" Grid.RowSpan="3" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="2" Text="Offset X1" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="3" Text="{Binding OffsetX1, UpdateSourceTrigger=PropertyChanged}" Margin="1" />

            <TextBlock Grid.Column="4" Text="Y1" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="5" Text="{Binding OffsetY1, UpdateSourceTrigger=PropertyChanged}" Margin="1" />

            <TextBlock Grid.Column="2" Grid.Row="1" Text="Offset X2" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="3" Grid.Row="1" Text="{Binding OffsetX2, UpdateSourceTrigger=PropertyChanged}" Margin="1" />

            <TextBlock Grid.Column="4" Grid.Row="1" Text="Y2" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="5" Grid.Row="1" Text="{Binding OffsetY2, UpdateSourceTrigger=PropertyChanged}" Margin="1" />

            <Rectangle Grid.Column="6" Grid.RowSpan="5" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="7" Text="Line Cap" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ComboBox Grid.Column="8" ItemsSource="{Binding Source={StaticResource lineCapsEnum}}" SelectedItem="{Binding LineCap}"/>

        </Grid>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:CurveShape}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition />
            </Grid.RowDefinitions>

            <ContentPresenter ContentTemplate="{StaticResource lineWithFillType}" Grid.RowSpan="4" />

            <Rectangle Grid.Column="1" Grid.RowSpan="3" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="2" Text="Offset X" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="3" Text="{Binding CurveX, UpdateSourceTrigger=PropertyChanged}" Margin="1" />

            <TextBlock Grid.Column="4" Text="Y" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="5" Text="{Binding CurveY, UpdateSourceTrigger=PropertyChanged}" Margin="1" />

            <Rectangle Grid.Column="6" Grid.RowSpan="5" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="7" Text="Line Cap" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ComboBox Grid.Column="8" ItemsSource="{Binding Source={StaticResource lineCapsEnum}}" SelectedItem="{Binding LineCap}"/>

        </Grid>
    </DataTemplate>


    <DataTemplate DataType="{x:Type c:TextShape}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Text brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="0" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage2}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}" Margin="1"/>

            <TextBlock Grid.Row="1" Grid.Column="0" Text="Font size" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="1" Grid.Row="1" Text="{Binding FontSize, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <Rectangle Grid.Column="2" Grid.RowSpan="2" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="3" Text="X" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="4" Text="{Binding X, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="5" Text="Y" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="6" Text="{Binding Y, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <Rectangle Grid.Column="7" Grid.RowSpan="2" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="8" Text="Font" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ComboBox Grid.Column="9" IsSynchronizedWithCurrentItem="True" ItemsSource="{x:Static Fonts.SystemFontFamilies}" DataContext="{Binding .}" SelectedItem="{Binding FontFamily}"/>

            <TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.ColumnSpan="10" AcceptsReturn="True" Margin="1,5,1,1" FontWeight="Normal"/>

        </Grid>
    </DataTemplate>


    <DataTemplate DataType="{x:Type c:PolygonShape}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>

                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Text="Stroke brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="0" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage2}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}" Margin="1"/>

            <TextBlock Grid.Row="1" Grid.Column="0" Text="Fill brush" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:ColorSelector Grid.Row="1" Grid.Column="1" Width="20" HorizontalAlignment="Right" SwatchImage="{StaticResource swatchimage}" SelectedColor="{Binding Fill, Converter={StaticResource brushtocolor}}" Margin="1"/>

            <Rectangle Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Fill="Gray" Height="1" Margin="3"/>

            <TextBlock Grid.Row="3" Grid.Column="0" Text="Stroke Thickness" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="1" Grid.Row="3" Text="{Binding StrokeThickness, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <TextBlock Grid.Row="4" Text="Line Cap" Margin="5,0,5,0"/>
            <ComboBox Grid.Row="4" Grid.Column="1" ItemsSource="{Binding Source={StaticResource lineCapsEnum}}" SelectedItem="{Binding LineCap}"/>

            <Rectangle Grid.Column="2" Grid.RowSpan="5" Fill="Gray" Width="1" Margin="5"/>

            <TextBlock Grid.Column="3" Text="Line Cap" Margin="5,0,5,0"/>
            <ComboBox Grid.Column="4" ItemsSource="{Binding Source={StaticResource lineCapsEnum}}" SelectedItem="{Binding LineCap}"/>

            <Button Command="cmds:ShapeCommands.CloseShape" Grid.Row="1" Grid.Column="4" HorizontalAlignment="Left">
                <TextBlock Text="Close shape"/>
            </Button>

        </Grid>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:ImageShape}">
        <!--<Grid>
            <ContentPresenter ContentTemplate="{StaticResource rectangleType}" />
        </Grid>-->

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <TextBlock Grid.Column="0" Text="X" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="1" Text="{Binding X, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="2" Text="Y" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="3" Text="{Binding Y, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

            <TextBlock Grid.Column="0" Grid.Row="1" Text="Height" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="1" Grid.Row="1" Text="{Binding Height, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>
            <TextBlock Grid.Column="2" Grid.Row="1" Text="Width" Margin="5,0,5,0" VerticalAlignment="Center"/>
            <ctrl:NumericTextBox Grid.Column="3" Grid.Row="1" Text="{Binding Width, UpdateSourceTrigger=PropertyChanged}" Margin="1"/>

        </Grid>
        
    </DataTemplate>

</ResourceDictionary>